#include"SList.h"

void TestSList1()
{
	/*SLTNode* plist = NULL;

	SLPushFront(&plist, 1);
	SLPushFront(&plist, 2);

	SLPushFront(&plist, 3);
	SLPushFront(&plist, 4);

	SLTPrint(plist);
	printf("\n");

	SLPushBack(&plist, 1);
	SLPushBack(plist, 2);
	SLPushBack(&plist, 3);*/
	
	//SLTPrint(plist);
	//printf("\n");

	//SLPopBack(&plist);
	//SLPopBack(&plist);
	//SLPopBack(&plist);
	//SLTPrint(plist);
}

void TestSList2()
{
	//SLTNode* plist = NULL;
	//SLPushFront(&plist, 1);
	//SLPushFront(&plist, 2);
	//SLPushFront(&plist, 3);
	//SLPushFront(&plist, 4);
	//SLTPrint(plist);
	//printf("\n");

	//SLPopBack(&plist);

	//SLTPrint(plist);
	//printf("\n");

	//SLTNode* pos = SLFind(plist, 3);
	//pos->data = 5;
	//SLTPrint(plist);
	//printf("\n");

	//SLInsertFront(&plist, pos, 10);
	//SLTPrint(plist);
	//printf("\n");
	//
	//SLInsertAfter(&plist, pos, 20);
	//SLTPrint(plist);
	//printf("\n");

}
void TestSList3()
{

	SLTNode* plist= NULL;
	SLPushBack(&plist, 1);
	SLPushBack(&plist, 2);
	SLPushBack(&plist, 3);
	SLPushBack(&plist, 4);

	SLTPrint(plist);

	SLPushFront(&plist, 5);
	SLPushFront(&plist, 6);
	SLPushFront(&plist, 7);
	SLPushFront(&plist, 8);

	printf("\n");

	SLTPrint(plist);

	SLPopBack(&plist);

	printf("\n");

	SLTPrint(plist);

	SLTNode* pos = SLFind(plist, 3);
	pos->data = 18;

	printf("\n");

	SLTPrint(plist);

	SLErase(&plist, pos);

	printf("\n");

	SLTPrint(plist);







}
int main()
{
	/*TestSList1();*/
	//TestSList2();
	TestSList3();
	return 0;
}
